class LogUtil {
  static const bool _print = true;

  // 工厂模式 : 单例公开访问点
  factory LogUtil() => _getInstance();

  static LogUtil get instance => _getInstance();
  static late LogUtil _instance;

  static LogUtil _getInstance() {
    _instance = LogUtil._internal();
    return _instance;
  }

  LogUtil._internal() {
// 初始化
  }

  void printf(String str, {String author = "jingo", String tag = ""}) {
    if (_print) print("$author $tag $str");
  }
}
